package com.eastcom.bm.service.impl;

import java.util.List;

import org.apache.log4j.Logger;

import com.eastcom.bm.atom.Atom_ActionRule;
import com.eastcom.bm.dao.DAOFactory;
import com.eastcom.bm.dao.IActionRuleDao;
import com.eastcom.bm.service.IActionRuleService;
import com.eastcom.common.db.JDBCTemplate;
import com.eastcom.providor.BMSetting;

public class ActionRuleService implements IActionRuleService {

	private static Logger log = BMSetting.getBMlog();
	
	public Atom_ActionRule getActionRuleByDataSetId(String datasetId) {
		try{
			IActionRuleDao actionRuleDao=DAOFactory.getInstance().getActionRuleDao();
			return actionRuleDao.getActionRuleByDataSetId(datasetId);
		}
		catch(Exception e){
			log.error("IActionRuleService getActionRuleByDataSetId error", e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

	public List<Atom_ActionRule> getAllActionRule() {
		try{
			IActionRuleDao actionRuleDao=DAOFactory.getInstance().getActionRuleDao();
			return actionRuleDao.getAllActionRule();
		}
		catch(Exception e){
			log.error("IActionRuleService getAllActionRule error", e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

}
